﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NUnit.Framework;

namespace Ruleweaver
{
	[TestFixture]
	public class DateTimeFixture
	{
		private readonly DateTime _sunday = new DateTime(2000, 1, 2);
		private readonly DateTime _monday = new DateTime(2000, 1, 3);
		private readonly DateTime _tuesday = new DateTime(2000, 1, 4);
		private readonly DateTime _wednesday = new DateTime(2000, 1, 5);
		private readonly DateTime _thursday = new DateTime(2000, 1, 6);
		private readonly DateTime _friday = new DateTime(2000, 1, 7);
		private readonly DateTime _saturday = new DateTime(2000, 1, 8);

		#region Weekends

		[Test]
		public void SundayIsWeekendPasses()
		{
			Assert.IsTrue(Check.That(_sunday).IsWeekend());
		}

		[Test]
		public void MondayIsWeekendFails()
		{
			Assert.IsFalse(Check.That(_monday).IsWeekend());
		}

		[Test]
		public void TuesdayIsWeekendFails()
		{
			Assert.IsFalse(Check.That(_tuesday).IsWeekend());
		}

		[Test]
		public void WednesdayIsWeekendFails()
		{
			Assert.IsFalse(Check.That(_wednesday).IsWeekend());
		}

		[Test]
		public void ThursdayIsWeekendFails()
		{
			Assert.IsFalse(Check.That(_thursday).IsWeekend());
		}

		[Test]
		public void FridayIsWeekendFails()
		{
			Assert.IsFalse(Check.That(_friday).IsWeekend());
		}

		[Test]
		public void SaturdayIsWeekendPasses()
		{
			Assert.IsTrue(Check.That(_saturday).IsWeekend());
		}
		#endregion

		#region Weekdays

		[Test]
		public void SundayIsWeekdayFails()
		{
			Assert.IsFalse(Check.That(_sunday).IsWeekday());
		}

		[Test]
		public void MondayIsWeekdayPasses()
		{
			Assert.IsTrue(Check.That(_monday).IsWeekday());
		}

		[Test]
		public void TuesdayIsWeekdayPasses()
		{
			Assert.IsTrue(Check.That(_tuesday).IsWeekday());
		}

		[Test]
		public void WednesdayIsWeekdayPasses()
		{
			Assert.IsTrue(Check.That(_wednesday).IsWeekday());
		}

		[Test]
		public void ThursdayIsWeekdayPasses()
		{
			Assert.IsTrue(Check.That(_thursday).IsWeekday());
		}

		[Test]
		public void FridayIsWeekdayPasses()
		{
			Assert.IsTrue(Check.That(_friday).IsWeekday());
		}

		[Test]
		public void SaturdayIsWeekdayFails()
		{
			Assert.IsFalse(Check.That(_saturday).IsWeekday());
		}
		#endregion

		[Test]
		public void TwoThousandIsLeapYearPasses()
		{
			Assert.IsTrue(Check.That(new DateTime(2000, 1, 1)).IsLeapYear());
		}

		[Test]
		public void TwoThousandOneIsLeapYearFails()
		{
			Assert.IsFalse(Check.That(new DateTime(2001, 1, 1)).IsLeapYear());
		}
	}
}